package edu.mapi.ir.gui;

import java.awt.Color;
import java.awt.GridLayout;
import java.util.LinkedHashMap;

import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.JPanel;

/**
 * @author ZP
 * @deprecated 
 */
public class SubsumptionPanel extends JPanel {
	
	private LinkedHashMap<String, JLabel> controllers = new LinkedHashMap<String, JLabel>();
	private String activeController = null;
	
	public SubsumptionPanel(String[] controllers) {
		setLayout(new GridLayout(0,1));
		for (String c : controllers) {
			JLabel lbl = new JLabel(c);
			lbl.setBackground(Color.white);
			lbl.setBorder(BorderFactory.createLineBorder(Color.black));
			lbl.setOpaque(true);
			add(lbl);
			this.controllers.put(c, lbl);
		}
	}
	
	public void setActiveController(String controller) {		
		if (activeController != null)
			controllers.get(activeController).setBackground(Color.white);
		
		if (controllers.containsKey(controller)) {
			activeController = controller;
			controllers.get(activeController).setBackground(Color.green.brighter());
		}
	}
	
	
}
